package com.sh;

import java.util.ArrayList;
import java.util.List;
import java.util.Stack;

/**
 * @Auther: sh
 * @Version 1.0
 * @Description:
 */
public class StringTest {
    public static void main(String[] args) {
        String str1 = "a.a.a,c";
        String[] split = str1.split("[.,]");
        for (String s : split) {
            System.out.println(s);
        }
        int length = str1.length();
        String substring = str1.substring(0, 3);
        int i = str1.indexOf("a");
        char c = str1.charAt(3);
        String replace = str1.replace("a", "b");
        str1.trim();
        String lowerCase = str1.toLowerCase();
        System.out.println(lowerCase);
        String upperCase = str1.toUpperCase();
        System.out.println(upperCase);
        boolean a = str1.contains("a");
        System.out.println(a);
//        str1="";
//        System.out.println(str1.isEmpty());
        byte[] bytes = str1.getBytes();
        for (byte aByte : bytes) {
            System.out.println(aByte);
        }
        char[] charArray = str1.toCharArray();
        ArrayList<Object> list = new ArrayList<>();
        list.toString();


final         ArrayList<Object> list1 = new ArrayList<>();
        ArrayList<Object> stringTests = new ArrayList<>();

        StringBuffer sb = new StringBuffer("hello");
        sb.append(" world");
        System.out.println(sb);  // hello world
        List list3=new ArrayList<Integer>();
        list3.add(3);



    }
    @Override
    protected void finalize() throws Throwable {
        try {
            System.out.println("finalize() 被调用，释放资源");
        } finally {
            super.finalize(); // 必须调用父类方法
        }
    }
}

